﻿<%@ Page Title="Thay đổi mật khẩu" Language="C#" MasterPageFile="~/App_MasterPages/Aquarius.Master"
    AutoEventWireup="true" CodeBehind="ChangePassword.aspx.cs" Inherits="SMSROUTER.UI.ChangePassword" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="CssContent">
    <style type="text/css">
        fieldset{padding: 10px 10px 10px 20px;}
        legend{margin: 0px 4px;padding:0px 4px;font-size:18px;font-weight:bold;width:auto;}
    </style>
</asp:Content>
<asp:Content ID="script_content" runat="server" ContentPlaceHolderID="ScriptContent">
    <script type="text/javascript">
        function ChangePasswordSucsess(url) {
            $("#dialog1").dialog({
                modal: true,
                buttons: {
                    Ok: function () {
                        window.location.href = url;
                    }
                }
            });
            $("#dialog1").dialog("open");
        }
    </script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Đổi mật khẩu
    </h2>
    <span class="failureNotification">
        <asp:Literal ID="FailureText" runat="server"></asp:Literal>
    </span>
    <div class="accountInfo">
        <fieldset class="changePassword" style="border: 1px solid">
            <legend>Thông tin tài khoản</legend>
            <p>
                <asp:Label ID="CurrentPasswordLabel" runat="server" AssociatedControlID="CurrentPassword">Mật khẩu cũ:</asp:Label>
                <asp:TextBox ID="CurrentPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ID="CurrentPasswordRequired" runat="server" ControlToValidate="CurrentPassword"
                    ForeColor="Red" ErrorMessage="Bắt buộc nhập mật khẩu cũ." ToolTip="Bắt buộc nhập mật khẩu cũ." Display="Dynamic"
                    ValidationGroup="ChangeUserPasswordValidationGroup" />
            </p>
            <p>
                <asp:Label ID="NewPasswordLabel" runat="server" AssociatedControlID="NewPassword">Mật khẩu mới:</asp:Label>
                <asp:TextBox ID="NewPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ID="NewPasswordRequired" runat="server" ControlToValidate="NewPassword"
                    ForeColor="Red" ErrorMessage="Bắt buộc nhập mật khẩu mới." ToolTip="Bắt buộc nhập mật khẩu mới." Display="Dynamic"
                    ValidationGroup="ChangeUserPasswordValidationGroup" />
                <asp:RegularExpressionValidator ID="RangePasswordRequired" runat="server" ControlToValidate="NewPassword"
                    ForeColor="Red" ErrorMessage="Mật khẩu phải có chữ và số, dài trong khoảng 6-50 ký tự"
                    ValidationGroup="ChangeUserPasswordValidationGroup" Display="Dynamic"
                    ValidationExpression="(?=.*\d)(?=.*[a-zA-Z]).{6,50}" />
                    
            </p>
            <p>
                <asp:Label ID="ConfirmNewPasswordLabel" runat="server" AssociatedControlID="ConfirmNewPassword">Xác nhận mật khẩu mới:</asp:Label>
                <asp:TextBox ID="ConfirmNewPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ID="ConfirmNewPasswordRequired" runat="server" ControlToValidate="ConfirmNewPassword"
                    ForeColor="Red" Display="Dynamic" ErrorMessage="Bắt buộc xác nhận mật khẩu mới."
                    ToolTip="Bắt buộc xác nhận mật khẩu mới." ValidationGroup="ChangeUserPasswordValidationGroup" />
                <asp:CompareValidator ID="NewPasswordCompare" runat="server" ControlToCompare="NewPassword"
                    ControlToValidate="ConfirmNewPassword" ForeColor="Red" Display="Dynamic"
                    ErrorMessage="Nhập lại mật khẩu không chính xác." ValidationGroup="ChangeUserPasswordValidationGroup" />
            </p>
            <p class="submitButton">
            <asp:Button ID="ChangePasswordPushButton" runat="server" CommandName="ChangePassword"
                    Text="OK" CssClass="btn" ValidationGroup="ChangeUserPasswordValidationGroup"
                    OnClick="ChangePasswordPushButton_Click" />
                <asp:Button ID="CancelPushButton" runat="server" CausesValidation="False" CommandName="Cancel"
                    Text="Cancel" CssClass="btn" OnClick="CancelPushButton_Click" />
            </p>
        </fieldset>
    </div>
    <div class="dialog" id="dialog1" title="" style="display: none;">
        <asp:Panel ID="pnl_dialog2" runat="server" CssClass="block">
            <div>
                <p>Đổi mật khẩu thành công</p>
            </div>
        </asp:Panel>
    </div>
</asp:Content>
